package be.xios.ti.droodle;

import java.awt.*;

/**
 * Concrete klasse om cirkels te tekenen
 * 
 * @author kris
 */
public final class CircleShape extends Shape {
	private int radius;
	
	public CircleShape(Color color, int x, int y, int size, boolean filled, int radius) {
		super(color,x,y,size,filled);
		this.radius = radius;
	}
	
	public CircleShape() {
		super();
		this.radius = 0;
	}
	
	/**
	 * @return Returns the radius.
	 */
	public int getRadius() {
		return radius;
	}
	/**
	 * @param radius The radius to set.
	 */
	public void setRadius(int radius) {
		this.radius = radius;
	}
	/**
	 * Teken de cirkel met behulp van de attributen
	 * @param g de graphics context
	 */
	public void draw(Graphics g) {
		Graphics2D g2d = (Graphics2D)g;
		
		g2d.setColor(getColor());
		g2d.setStroke(new BasicStroke((float)getSize()));
		if (isFilled())
			g2d.fillArc(getX()-radius,getY()-radius,radius*2,radius*2,0,360);
		else
			g2d.drawArc(getX()-radius,getY()-radius,radius*2,radius*2,0,360);
	}

}
